The QuickTime VR Manager provides functions that you can use to help manage the memory used by QuickTime VR.
You can use the QTVRGetAvailableResolutions function to get the image resolutions present in the current node.
OSErr QTVRGetAvailableResolutions (
QTVRInstance qtvr,
UInt16*resolutionsMask);
The QTVRGetAvailableResolutions function returns, in the unsigned short integer pointed to by the resolutionsMask parameter, a bitmask that encodes the image resolutions available at the current node of the QuickTime VR movie specified by the qtvr parameter.
A single node can contain multiple resolutions of a panorama or an object. The lowest order bit is always set and corresponds to the base resolution of the node. Each succeeding bit corresponds to a resolution that is half that (both horizontally and vertically) of the preceding bit. If an image with a resolution is present in the current node, the corresponding bit is set.
QuickTime VR maintains an internal back buffer for caching panoramic images. You can use the QTVRGetBackBufferMemInfo function to get information about the size of the back buffer that would be required for caching a panoramic image of a specified pixel format, geometry, and resolution. See "Pixel Formats" for more information.
OSErr QTVRGetBackBufferMemInfo (
QTVRInstance qtvr,
UInt16 geometry,
UInt16 resolution,
UInt32 cachePixelFormat,
SInt32 *minCacheBytes,
SInt32 *suggestedCacheBytes,
SInt32 *fullCacheBytes);
The QTVRGetBackBufferMemInfo function returns information about the size of the back buffer that would be required to hold some or all of the panoramic image associated with the movie specified by the qtvr parameter. This is a "what-if" function: you specify a resolution and a pixel format, and QTVRGetBackBufferMemInfo returns several buffer sizes. You can use this information, in conjunction with the QTVRSetBackBufferPrefs function, to exercise some control over the size of the back buffer.
The resolution at which an image is to be displayed is specified by the resolution parameter. You can use a resolution that is not in the movie file. Relative to that resolution and the pixel depth determined by the cachePixelFormat parameter, the QTVRGetBackBufferMemInfo function returns, through the minCacheBytes parameter, the minimum size of the buffer needed to display the movie. Using a buffer of that size, however, may result in a severely limited maximum field of view. You can call the QTVRGetViewingLimits function to determine the actual maximum field of view.
To allow full wide-angle zooming, you should use a buffer whose size is specified by either the suggestedCacheBytes parameter or the fullCacheBytes parameter.
You can use the QTVRGetBackBufferSettings function to get information about the resolution, pixel format, and size of the back buffer maintained internally by QuickTime VR for caching a panoramic image in a particular pixel format.
OSErr QTVRGetBackBufferSettings (
QTVRInstance qtvr,
UInt16 *geometry,
UInt16 *resolution,
UInt32 *cachePixelFormat,
SInt16 *cacheSize);
The QTVRGetBackBufferSettings function returns, through the resolution parameter, the index of the current resolution for the QuickTime VR movie specified by the qtvr parameter. The index indicates which bit in the mask value returned by QTVRGetAvailableResolutions specifies the current resolution. For example, if the returned index is 1, the base resolution is being used. If the returned index is 2, then a resolution of half the base resolution is being used.
QTVRGetBackBufferSettings also returns the pixel format and the cache size in the cachePixelFormat and cacheSize parameters, respectively.
The QuickTime VR file might not contain an image track corresponding to the resolution indicated by the resolution value returned. The QuickTime VR Manager may have set a lower resolution because memory is low, or the resolution may have been set by a call to the QTVRSetBackBufferPrefs function.
Use QTVRSetBackBufferPrefs (next) to set the resolution, cache depth, and cache size of the panorama back buffer maintained internally by QuickTime VR for caching an image. Use QTVRGetAvailableResolutions to determine which resolutions are supported by a node. Use QTVRGetBackBufferMemInfo to determine the memory requirements for the preferred settings.
You can use the QTVRSetBackBufferPrefs function to set the resolution, pixel format, and size of the back buffer maintained internally by QuickTime VR for caching a panoramic image in a particular pixel format.
OSErr QTVRSetBackBufferPrefs (
QTVRInstance qtvr,
UInt16 geometry,
UInt16 resolution,
UInt32 cachePixelFormat,
SInt16 cacheSize);
The QTVRSetBackBufferPrefs function sets the resolution, pixel format, and size of the panorama back buffer for the movie specified by the qtvr parameter to the values specified by the resolution , cachePixelFormat , and cacheSize parameters. You can specify a resolution that isn't contained in the movie file; if you do so, QuickTime VR takes the highest resolution image in the file and reduces it to fit into the specified buffer size.
If you specify an unsupported pixel format, the QTVRSetBackBufferPrefs function may return an error. See "Pixel Formats" for more information.
Use QTVRGetAvailableResolutions to determine which resolutions are supported by a node. Use QTVRGetBackBufferMemInfo to determine the memory requirements for the preferred settings.
| Previous | Chapter Contents | Chapter Top | Next |